#ifndef STRUCTS_H_INCLUDED
#define STRUCTS_H_INCLUDED
#include <iostream>

class ugyfels{          //DONE

    public:
    friend std::istream& operator>>(std::istream& i, ugyfels& x)
        { i>>x.nev>>x.filenev; return i; }
    friend std::ostream& operator<<(std::ostream& o, const ugyfels& x)
        { o<<x.nev; return o; }

    std::string getNev() {return nev;}
    void setNev(std::string s) {nev=s;}
    std::string getTelefonszam() {return telefonszam;}
    void setTelefonszam(std::string s) {telefonszam=s;}

    void setAll(){
        std::cout << "Uj ugyfel neve: ";
        std::cin >> nev;

        std::cout << "Uj ugyfel telefonszama: ";
        std::cin >> telefonszam;
    }

    private:
    std::string nev;
    std::string telefonszam;
    std::string filenev;
};

struct jarmus{          //DONE

    public:
    friend std::istream& operator>>(std::istream& i, jarmus& x)
        { i>>x.rendsz>>x.filenev; return i; }
    friend std::ostream& operator<<(std::ostream& o, const jarmus& x)
        { o<<x.rendsz; return o; }

    std::string getTipus() {return tipus;}
    void setTipus(std::string s) {tipus=s;}
    std::string getGyartmany() {return gyartmany;}
    void setGyartmany(std::string s) {gyartmany=s;}
    int getEvjarat() {return evjarat;}
    void setEvjarat(int s) {evjarat=s;}
    std::string getKivitel() {return kivitel;}
    void setKivitel(std::string s) {kivitel=s;}
    int getHengerurtartalom() {return hengerurtartalom;}
    void setHengerurtartalom(int s) {hengerurtartalom=s;}
    std::string getUzemanyag() {return uzemanyag;}
    void setUzemanyag(std::string s) {uzemanyag=s;}
    int getMotorszam() {return motorszam;}
    void setMotorszam(int s) {motorszam=s;}
    int getAlvazszam() {return alvazszam;}
    void setAlvazszam(int s) {alvazszam=s;}
    std::string getRendsz() {return rendsz;}
    void setRendsz(std::string s) {rendsz=s;}

    void setAll(){
        std::cout << "Uj jarmu tipusa: ";
        std::cin >> tipus;
        std::cout << "Uj jarmu gyartmanya: ";
        std::cin >> gyartmany;

        do{
        std::string rubbish;
        std::cin.clear();
        std::getline(std::cin,rubbish,'\n');
        std::cout << "Uj jarmu evjarata: ";
        std::cin >> evjarat;
        }
        while (evjarat<0 || std::cin.fail());

        std::cout << "Uj jarmu kivitele: ";
        std::cin >> kivitel;

        do{
        std::string rubbish;
        std::cin.clear();
        std::getline(std::cin,rubbish,'\n');
        std::cout << "Uj jarmu hengerurtartalma: ";
        std::cin >> hengerurtartalom;
        }
        while (hengerurtartalom<0 || std::cin.fail());

        std::cout << "Uj jarmu uzemanyagtipus: ";
        std::cin >> uzemanyag;

        do{
        std::string rubbish;
        std::cin.clear();
        std::getline(std::cin,rubbish,'\n');
        std::cout << "Uj jarmu motorszama: ";
        std::cin >> motorszam;
        }
        while (motorszam<0 || std::cin.fail());

        do{
        std::string rubbish;
        std::cin.clear();
        std::getline(std::cin,rubbish,'\n');
        std::cout << "Uj jarmu alvazszama: ";
        std::cin >> alvazszam;
        }
        while (alvazszam<0 || std::cin.fail());

        std::cout << "Uj jarmu rendszama: ";
        std::cin >> rendsz;
    }

    private:
        std::string tipus;
        std::string gyartmany;
        int evjarat;
        std::string kivitel;
        int hengerurtartalom;
        std::string uzemanyag;
        int motorszam;
        int alvazszam;
        std::string rendsz;
        std::string filenev;
};

class szervizlaps{

    public:
    friend std::istream& operator>>(std::istream& i, szervizlaps& x)
        { i>>x.datum>>x.filenev; return i; }
    friend std::ostream& operator<<(std::ostream& o, const szervizlaps& x)
        { o<<x.datum; return o; }

    std::string getDatum() {return datum;}
    void setDatum(std::string s) {datum=s;}

    void setAll(){
        std::cout << "Uj szervizlap datuma: ";
        std::cin >> datum;
    }

    private:
    std::string datum;
    std::string filenev;
};

class tetels{

    public:
    friend std::istream& operator>>(std::istream& i, tetels& x)
        { i>>x.nev>>x.ar; return i; }
      friend std::ostream& operator<<(std::ostream& o, const tetels& x)
        { o<<x.nev<<" "<<x.ar; return o; }

    std::string getNev() {return nev;}
    void setNev(std::string s) {nev=s;}
    int getAr() {return ar;}
    void setAr(int s) {ar=s;}

    void setAll(){
        std::cout << "Uj tetel neve: ";
        std::cin >> nev;
        do{
        std::string rubbish;
        std::cin.clear();
        std::getline(std::cin,rubbish,'\n');
        std::cout << "Uj tetel ara: ";
        std::cin >> ar;
        }
        while (ar<0 || std::cin.fail());
    }

    private:
    std::string nev;
    int ar;
};


#endif // STRUCTS_H_INCLUDED
